<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">
    <ui:composition template="index.xhtml">
        <ui:define name="body">

            <h:form id="form" acceptcharset="utf-8">
                <p:growl id="msg" life="3000"/>
                <p:panel header="Edital Cartório" style="border: 0px; width: 100%">
                    <p:fieldset style="border: 0px;">
                        <fieldset style="border: 1px solid #E3E3E3; color: #3DA2DC; font-size: 13px;">
                            <legend>Edital Cartório</legend><br/>
                            <h:panelGrid  columns="2" style=" color: #000000; font-size: 12px; font-family: sans-serif"> 

                                <h:outputLabel value="Cartório :  " style="float: right"/>
                                <p:autoComplete id="cartorio" value="#{managerRelEdictNotary.notaryOffice}" 
                                                completeMethod="#{managerCreateNotaryOffice.completeNotary}"   
                                                var="c" itemLabel="#{c.nome}" itemValue="#{c}" 
                                                converter="notaryOfficeConverter" forceSelection="true" 
                                                minQueryLength="3" label="Cartorio"
                                                dropdown="true" required="true"  size="50" > 
                                    <p:ajax event="itemSelect" listener="#{managerRelEdictNotary.handleSelectNotary}" 
                                            process="@this"/> 
                                </p:autoComplete>
                            </h:panelGrid> 
                            <br/>
                            <center>
                                <p:commandButton value="Voltar" icon="ui-icon-arrowreturnthick-1-w"  style="font-size: 12px; font-family: sans-serif;" actionListener="#{managerRedirect.redirect('edict.xhtml')}" immediate="true"/>
                                <p:commandButton value="Pesquisar" icon="ui-icon-search"  style="font-size: 12px; font-family: sans-serif;" actionListener="#{managerRelEdictNotary.searchQuestionnaireReponse()}" update="@form, table"/>
                            </center>
                            <br/> 
                            <p:dataTable value="#{managerRelEdictNotary.lstQuesReponse}"
                                         var="q" id="table"  paginator="true" rows="5" style="width: 100%" 
                                         paginatorPosition="bottom"
                                         emptyMessage="Nenhuma Correição encontrada"
                                         paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink}"  
                                         rowsPerPageTemplate="5,10,15"
                                         >
                                <f:facet name="header">
                                    Correição

                                </f:facet>  

                                <p:column headerText="Cartório" style="width: 400px;">
                                    <p:outputLabel value="#{q.notaryOffice.nome}"/>
                                </p:column>
                                <p:column headerText="Executor" style="width: 300px;">
                                    <p:outputLabel value="#{q.executor.name}"/>
                                </p:column>
                                <p:column headerText="Data Q" style="200px;">
                                    <h:outputText value="#{q.dateQ}">
                                        <f:convertDateTime pattern="dd/MM/yyyy"/>

                                    </h:outputText>


                                </p:column>

                                <p:column headerText="Opções" style="font-size: 12px;">
                                    <p:commandButton icon="ui-icon-print" title="Visualizar Edital"
                                                     ajax="false" actionListener="#{managerRelEdit.generetorReportPdf(q)}" update="@form"/>
                                    <!--<p:commandButton icon="ui-icon-play" title="Dados da Correição" actionListener="{managerEditQuestionnaireResponse.viewIssues(q)}" update="@form"/>-->
                                </p:column>
                            </p:dataTable>    
                        </fieldset>
                    </p:fieldset>


                </p:panel>
                <center>
                </center>
            </h:form>
        </ui:define>
    </ui:composition>
</html>


